Electrical devices in a smart grid are sometimes subject to security attacks by malicious adversaries. For example, substations in the smart grid are connected to external public and non-public networks that facilitate easy access by non-authorized users to the devices in the substations.